/**
 * Created by DragonSea
 * on 2018-10-11
 */
import java.io.FileOutputStream;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
public class Test1 {
    public static void main(String[] args) throws Exception {
        //定义一个新的工作簿
        HSSFWorkbook workbook = new HSSFWorkbook();
        //创建sheet1
        Sheet sheet = workbook.createSheet("sheet1");
        //创建sheet2
        workbook.createSheet("sheet2");
        //创建行
        Row row = sheet.createRow(0);
        //创建单元格
        row.createCell(0).setCellValue("省份证号");
        row.createCell(1).setCellValue("年龄");
        row.createCell(2).setCellValue("性别");
        row.createCell(3).setCellValue("身高");
        //创建一个输出流
        FileOutputStream fileOutputStream = new FileOutputStream("D:\\简单的工作簿.xls");
        //写入
        workbook.write(fileOutputStream);
    }
}




